#!/bin/bash

set -eux

### --start_docs
## Prepare images for deploying the overcloud
## ==========================================

## Prepare Your Environment
## ------------------------

## * Source in the undercloud credentials.
## ::

source {{ working_dir }}/stackrc

## * Create and upload image to glance, this step is specific to nodepool based deployments.
## ::

rpm -q qemu-img || sudo {{ ansible_pkg_mgr }} install -y qemu-img
qemu-img create -f qcow2 {{ overcloud_image }}.qcow2 1G

glance image-create --container-format bare \
    --disk-format qcow2 \
    --name {{ overcloud_image }} \
    --file {{ overcloud_image }}.qcow2

### --stop_docs
